<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>oauth2client.gce</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="oauth2client-module.html">Package&nbsp;oauth2client</a> ::
        Module&nbsp;gce
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="oauth2client.gce-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="oauth2client.gce-module.html">Module oauth2client.gce</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) 2012 Google Inc.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-comment"># Licensed under the Apache License, Version 2.0 (the "License");</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-comment"># you may not use this file except in compliance with the License.</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-comment"># You may obtain a copy of the License at</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-comment">#      http://www.apache.org/licenses/LICENSE-2.0</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-comment"># Unless required by applicable law or agreed to in writing, software</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-comment"># distributed under the License is distributed on an "AS IS" BASIS,</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-comment"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-comment"># See the License for the specific language governing permissions and</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-comment"># limitations under the License.</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-docstring">"""Utilities for Google Compute Engine</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-docstring">Utilities for making it easier to use OAuth 2.0 on Google Compute Engine.</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-name">__author__</tt> <tt class="py-op">=</tt> <tt class="py-string">'jcgregorio@google.com (Joe Gregorio)'</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">httplib2</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">uritemplate</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package oauth2client=oauth2client-module.html"><a title="oauth2client" class="py-name" href="#" onclick="return doclink('link-0', 'oauth2client', 'link-0');">oauth2client</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module oauth2client.util=oauth2client.util-module.html"><a title="oauth2client.util" class="py-name" href="#" onclick="return doclink('link-1', 'util', 'link-1');">util</a></tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name"><a title="oauth2client" class="py-name" href="#" onclick="return doclink('link-2', 'oauth2client', 'link-0');">oauth2client</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Module oauth2client.anyjson=oauth2client.anyjson-module.html"><a title="oauth2client.anyjson" class="py-name" href="#" onclick="return doclink('link-3', 'anyjson', 'link-3');">anyjson</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">simplejson</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name"><a title="oauth2client" class="py-name" href="#" onclick="return doclink('link-4', 'oauth2client', 'link-0');">oauth2client</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Module oauth2client.client=oauth2client.client-module.html"><a title="oauth2client.client" class="py-name" href="#" onclick="return doclink('link-5', 'client', 'link-5');">client</a></tt> <tt class="py-keyword">import</tt> <tt id="link-6" class="py-name" targets="Class oauth2client.client.AccessTokenRefreshError=oauth2client.client.AccessTokenRefreshError-class.html"><a title="oauth2client.client.AccessTokenRefreshError" class="py-name" href="#" onclick="return doclink('link-6', 'AccessTokenRefreshError', 'link-6');">AccessTokenRefreshError</a></tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-7" class="py-name"><a title="oauth2client" class="py-name" href="#" onclick="return doclink('link-7', 'oauth2client', 'link-0');">oauth2client</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="oauth2client.client" class="py-name" href="#" onclick="return doclink('link-8', 'client', 'link-5');">client</a></tt> <tt class="py-keyword">import</tt> <tt id="link-9" class="py-name" targets="Class oauth2client.client.AssertionCredentials=oauth2client.client.AssertionCredentials-class.html"><a title="oauth2client.client.AssertionCredentials" class="py-name" href="#" onclick="return doclink('link-9', 'AssertionCredentials', 'link-9');">AssertionCredentials</a></tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt id="link-10" class="py-name" targets="Variable apiclient.discovery.logger=apiclient.discovery-module.html#logger,Variable oauth2client.appengine.logger=oauth2client.appengine-module.html#logger,Variable oauth2client.client.logger=oauth2client.client-module.html#logger,Variable oauth2client.crypt.logger=oauth2client.crypt-module.html#logger,Variable oauth2client.gce.logger=oauth2client.gce-module.html#logger,Variable oauth2client.locked_file.logger=oauth2client.locked_file-module.html#logger,Variable oauth2client.multistore_file.logger=oauth2client.multistore_file-module.html#logger,Variable oauth2client.util.logger=oauth2client.util-module.html#logger"><a title="apiclient.discovery.logger
oauth2client.appengine.logger
oauth2client.client.logger
oauth2client.crypt.logger
oauth2client.gce.logger
oauth2client.locked_file.logger
oauth2client.multistore_file.logger
oauth2client.util.logger" class="py-name" href="#" onclick="return doclink('link-10', 'logger', 'link-10');">logger</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">getLogger</tt><tt class="py-op">(</tt><tt class="py-name">__name__</tt><tt class="py-op">)</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line"><tt class="py-comment"># URI Template for the endpoint that returns access_tokens.</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt id="link-11" class="py-name" targets="Variable oauth2client.gce.META=oauth2client.gce-module.html#META"><a title="oauth2client.gce.META" class="py-name" href="#" onclick="return doclink('link-11', 'META', 'link-11');">META</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-string">'http://metadata.google.internal/0.1/meta-data/service-accounts/'</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-string">'default/acquire{?scope}'</tt><tt class="py-op">)</tt> </tt>
<a name="AppAssertionCredentials"></a><div id="AppAssertionCredentials-def"><a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt> <a class="py-toggle" href="#" id="AppAssertionCredentials-toggle" onclick="return toggle('AppAssertionCredentials');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="oauth2client.gce.AppAssertionCredentials-class.html">AppAssertionCredentials</a><tt class="py-op">(</tt><tt class="py-base-class">AssertionCredentials</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AppAssertionCredentials-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="AppAssertionCredentials-expanded"><a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">  <tt class="py-docstring">"""Credentials object for Compute Engine Assertion Grants</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"><tt class="py-docstring">  This object will allow a Compute Engine instance to identify itself to</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"><tt class="py-docstring">  Google and other OAuth 2.0 servers that can verify assertions. It can be used</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"><tt class="py-docstring">  for the purpose of accessing data stored under an account assigned to the</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line"><tt class="py-docstring">  Compute Engine instance itself.</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line"><tt class="py-docstring">  This credential does not require a flow to instantiate because it represents</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line"><tt class="py-docstring">  a two legged flow, and therefore has all of the required information to</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line"><tt class="py-docstring">  generate and refresh its own access tokens.</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line"> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">util</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Function oauth2client.util.positional()=oauth2client.util-module.html#positional"><a title="oauth2client.util.positional" class="py-name" href="#" onclick="return doclink('link-12', 'positional', 'link-12');">positional</a></tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="AppAssertionCredentials.__init__"></a><div id="AppAssertionCredentials.__init__-def"><a name="L52"></a><tt class="py-lineno">52</tt> <a class="py-toggle" href="#" id="AppAssertionCredentials.__init__-toggle" onclick="return toggle('AppAssertionCredentials.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="oauth2client.gce.AppAssertionCredentials-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">scope</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AppAssertionCredentials.__init__-collapsed" style="display:none;" pad="++" indent="++++++"></div><div id="AppAssertionCredentials.__init__-expanded"><a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">    <tt class="py-docstring">"""Constructor for AppAssertionCredentials</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"><tt class="py-docstring">    Args:</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"><tt class="py-docstring">      scope: string or list of strings, scope(s) of the credentials being</tt> </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line"><tt class="py-docstring">        requested.</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">scope</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">list</tt><tt class="py-op">:</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">      <tt class="py-name">scope</tt> <tt class="py-op">=</tt> <tt class="py-string">' '</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">scope</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scope</tt> <tt class="py-op">=</tt> <tt class="py-name">scope</tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">    <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-13" class="py-name" targets="Class oauth2client.appengine.AppAssertionCredentials=oauth2client.appengine.AppAssertionCredentials-class.html,Class oauth2client.gce.AppAssertionCredentials=oauth2client.gce.AppAssertionCredentials-class.html"><a title="oauth2client.appengine.AppAssertionCredentials
oauth2client.gce.AppAssertionCredentials" class="py-name" href="#" onclick="return doclink('link-13', 'AppAssertionCredentials', 'link-13');">AppAssertionCredentials</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method apiclient.errors.BatchError.__init__()=apiclient.errors.BatchError-class.html#__init__,Method apiclient.errors.HttpError.__init__()=apiclient.errors.HttpError-class.html#__init__,Method apiclient.errors.UnexpectedBodyError.__init__()=apiclient.errors.UnexpectedBodyError-class.html#__init__,Method apiclient.errors.UnexpectedMethodError.__init__()=apiclient.errors.UnexpectedMethodError-class.html#__init__,Method apiclient.http.BatchHttpRequest.__init__()=apiclient.http.BatchHttpRequest-class.html#__init__,Method apiclient.http.HttpMock.__init__()=apiclient.http.HttpMock-class.html#__init__,Method apiclient.http.HttpMockSequence.__init__()=apiclient.http.HttpMockSequence-class.html#__init__,Method apiclient.http.HttpRequest.__init__()=apiclient.http.HttpRequest-class.html#__init__,Method apiclient.http.HttpRequestMock.__init__()=apiclient.http.HttpRequestMock-class.html#__init__,Method apiclient.http.MediaDownloadProgress.__init__()=apiclient.http.MediaDownloadProgress-class.html#__init__,Method apiclient.http.MediaFileUpload.__init__()=apiclient.http.MediaFileUpload-class.html#__init__,Method apiclient.http.MediaInMemoryUpload.__init__()=apiclient.http.MediaInMemoryUpload-class.html#__init__,Method apiclient.http.MediaIoBaseDownload.__init__()=apiclient.http.MediaIoBaseDownload-class.html#__init__,Method apiclient.http.MediaIoBaseUpload.__init__()=apiclient.http.MediaIoBaseUpload-class.html#__init__,Method apiclient.http.MediaUploadProgress.__init__()=apiclient.http.MediaUploadProgress-class.html#__init__,Method apiclient.http.RequestMockBuilder.__init__()=apiclient.http.RequestMockBuilder-class.html#__init__,Method apiclient.http._StreamSlice.__init__()=apiclient.http._StreamSlice-class.html#__init__,Method apiclient.model.JsonModel.__init__()=apiclient.model.JsonModel-class.html#__init__,Method apiclient.model.ProtocolBufferModel.__init__()=apiclient.model.ProtocolBufferModel-class.html#__init__,Method apiclient.schema.Schemas.__init__()=apiclient.schema.Schemas-class.html#__init__,Method apiclient.schema._SchemaToStruct.__init__()=apiclient.schema._SchemaToStruct-class.html#__init__,Method oauth2client.appengine.AppAssertionCredentials.__init__()=oauth2client.appengine.AppAssertionCredentials-class.html#__init__,Method oauth2client.appengine.OAuth2Decorator.__init__()=oauth2client.appengine.OAuth2Decorator-class.html#__init__,Method oauth2client.appengine.OAuth2DecoratorFromClientSecrets.__init__()=oauth2client.appengine.OAuth2DecoratorFromClientSecrets-class.html#__init__,Method oauth2client.appengine.StorageByKeyName.__init__()=oauth2client.appengine.StorageByKeyName-class.html#__init__,Method oauth2client.client.AccessTokenCredentials.__init__()=oauth2client.client.AccessTokenCredentials-class.html#__init__,Method oauth2client.client.AssertionCredentials.__init__()=oauth2client.client.AssertionCredentials-class.html#__init__,Method oauth2client.client.MemoryCache.__init__()=oauth2client.client.MemoryCache-class.html#__init__,Method oauth2client.client.OAuth2Credentials.__init__()=oauth2client.client.OAuth2Credentials-class.html#__init__,Method oauth2client.client.OAuth2WebServerFlow.__init__()=oauth2client.client.OAuth2WebServerFlow-class.html#__init__,Method oauth2client.client.SignedJwtAssertionCredentials.__init__()=oauth2client.client.SignedJwtAssertionCredentials-class.html#__init__,Method oauth2client.crypt.Signer.__init__()=oauth2client.crypt.Signer-class.html#__init__,Method oauth2client.crypt.Verifier.__init__()=oauth2client.crypt.Verifier-class.html#__init__,Method oauth2client.django_orm.CredentialsField.__init__()=oauth2client.django_orm.CredentialsField-class.html#__init__,Method oauth2client.django_orm.FlowField.__init__()=oauth2client.django_orm.FlowField-class.html#__init__,Method oauth2client.django_orm.Storage.__init__()=oauth2client.django_orm.Storage-class.html#__init__,Method oauth2client.file.Storage.__init__()=oauth2client.file.Storage-class.html#__init__,Method oauth2client.gce.AppAssertionCredentials.__init__()=oauth2client.gce.AppAssertionCredentials-class.html#__init__,Method oauth2client.keyring_storage.Storage.__init__()=oauth2client.keyring_storage.Storage-class.html#__init__,Method oauth2client.locked_file.LockedFile.__init__()=oauth2client.locked_file.LockedFile-class.html#__init__,Method oauth2client.locked_file._Opener.__init__()=oauth2client.locked_file._Opener-class.html#__init__,Method oauth2client.multistore_file._MultiStore._Storage.__init__()=oauth2client.multistore_file._MultiStore._Storage-class.html#__init__,Method oauth2client.multistore_file._MultiStore.__init__()=oauth2client.multistore_file._MultiStore-class.html#__init__"><a title="apiclient.errors.BatchError.__init__
apiclient.errors.HttpError.__init__
apiclient.errors.UnexpectedBodyError.__init__
apiclient.errors.UnexpectedMethodError.__init__
apiclient.http.BatchHttpRequest.__init__
apiclient.http.HttpMock.__init__
apiclient.http.HttpMockSequence.__init__
apiclient.http.HttpRequest.__init__
apiclient.http.HttpRequestMock.__init__
apiclient.http.MediaDownloadProgress.__init__
apiclient.http.MediaFileUpload.__init__
apiclient.http.MediaInMemoryUpload.__init__
apiclient.http.MediaIoBaseDownload.__init__
apiclient.http.MediaIoBaseUpload.__init__
apiclient.http.MediaUploadProgress.__init__
apiclient.http.RequestMockBuilder.__init__
apiclient.http._StreamSlice.__init__
apiclient.model.JsonModel.__init__
apiclient.model.ProtocolBufferModel.__init__
apiclient.schema.Schemas.__init__
apiclient.schema._SchemaToStruct.__init__
oauth2client.appengine.AppAssertionCredentials.__init__
oauth2client.appengine.OAuth2Decorator.__init__
oauth2client.appengine.OAuth2DecoratorFromClientSecrets.__init__
oauth2client.appengine.StorageByKeyName.__init__
oauth2client.client.AccessTokenCredentials.__init__
oauth2client.client.AssertionCredentials.__init__
oauth2client.client.MemoryCache.__init__
oauth2client.client.OAuth2Credentials.__init__
oauth2client.client.OAuth2WebServerFlow.__init__
oauth2client.client.SignedJwtAssertionCredentials.__init__
oauth2client.crypt.Signer.__init__
oauth2client.crypt.Verifier.__init__
oauth2client.django_orm.CredentialsField.__init__
oauth2client.django_orm.FlowField.__init__
oauth2client.django_orm.Storage.__init__
oauth2client.file.Storage.__init__
oauth2client.gce.AppAssertionCredentials.__init__
oauth2client.keyring_storage.Storage.__init__
oauth2client.locked_file.LockedFile.__init__
oauth2client.locked_file._Opener.__init__
oauth2client.multistore_file._MultiStore._Storage.__init__
oauth2client.multistore_file._MultiStore.__init__" class="py-name" href="#" onclick="return doclink('link-14', '__init__', 'link-14');">__init__</a></tt><tt class="py-op">(</tt> </tt>
<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line">        <tt class="py-string">'ignored'</tt> <tt class="py-comment"># assertion_type is ignore in this subclass.</tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line"> </tt>
<a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">classmethod</tt> </tt>
<a name="AppAssertionCredentials.from_json"></a><div id="AppAssertionCredentials.from_json-def"><a name="L68"></a><tt class="py-lineno">68</tt> <a class="py-toggle" href="#" id="AppAssertionCredentials.from_json-toggle" onclick="return toggle('AppAssertionCredentials.from_json');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="oauth2client.gce.AppAssertionCredentials-class.html#from_json">from_json</a><tt class="py-op">(</tt><tt class="py-param">cls</tt><tt class="py-op">,</tt> <tt class="py-param">json</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AppAssertionCredentials.from_json-collapsed" style="display:none;" pad="++" indent="++++++"></div><div id="AppAssertionCredentials.from_json-expanded"><a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line">    <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">simplejson</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Function oauth2client.clientsecrets.loads()=oauth2client.clientsecrets-module.html#loads"><a title="oauth2client.clientsecrets.loads" class="py-name" href="#" onclick="return doclink('link-15', 'loads', 'link-15');">loads</a></tt><tt class="py-op">(</tt><tt class="py-name">json</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-16" class="py-name"><a title="oauth2client.appengine.AppAssertionCredentials
oauth2client.gce.AppAssertionCredentials" class="py-name" href="#" onclick="return doclink('link-16', 'AppAssertionCredentials', 'link-13');">AppAssertionCredentials</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">[</tt><tt class="py-string">'scope'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line"> </tt>
<a name="AppAssertionCredentials._refresh"></a><div id="AppAssertionCredentials._refresh-def"><a name="L72"></a><tt class="py-lineno">72</tt> <a class="py-toggle" href="#" id="AppAssertionCredentials._refresh-toggle" onclick="return toggle('AppAssertionCredentials._refresh');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="oauth2client.gce.AppAssertionCredentials-class.html#_refresh">_refresh</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">http_request</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AppAssertionCredentials._refresh-collapsed" style="display:none;" pad="++" indent="++++++"></div><div id="AppAssertionCredentials._refresh-expanded"><a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line">    <tt class="py-docstring">"""Refreshes the access_token.</tt> </tt>
<a name="L74"></a><tt class="py-lineno">74</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line"><tt class="py-docstring">    Skip all the storage hoops and just refresh using the API.</tt> </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line"><tt class="py-docstring">    Args:</tt> </tt>
<a name="L78"></a><tt class="py-lineno">78</tt>  <tt class="py-line"><tt class="py-docstring">      http_request: callable, a callable that matches the method signature of</tt> </tt>
<a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line"><tt class="py-docstring">        httplib2.Http.request, used to make the refresh request.</tt> </tt>
<a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line"><tt class="py-docstring">    Raises:</tt> </tt>
<a name="L82"></a><tt class="py-lineno">82</tt>  <tt class="py-line"><tt class="py-docstring">      AccessTokenRefreshError: When the refresh fails.</tt> </tt>
<a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L84"></a><tt class="py-lineno">84</tt>  <tt class="py-line">    <tt class="py-name">uri</tt> <tt class="py-op">=</tt> <tt class="py-name">uritemplate</tt><tt class="py-op">.</tt><tt class="py-name">expand</tt><tt class="py-op">(</tt><tt id="link-17" class="py-name"><a title="oauth2client.gce.META" class="py-name" href="#" onclick="return doclink('link-17', 'META', 'link-11');">META</a></tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-string">'scope'</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scope</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
<a name="L85"></a><tt class="py-lineno">85</tt>  <tt class="py-line">    <tt id="link-18" class="py-name" targets="Method apiclient.model.BaseModel.response()=apiclient.model.BaseModel-class.html#response,Method apiclient.model.Model.response()=apiclient.model.Model-class.html#response"><a title="apiclient.model.BaseModel.response
apiclient.model.Model.response" class="py-name" href="#" onclick="return doclink('link-18', 'response', 'link-18');">response</a></tt><tt class="py-op">,</tt> <tt class="py-name">content</tt> <tt class="py-op">=</tt> <tt class="py-name">http_request</tt><tt class="py-op">(</tt><tt class="py-name">uri</tt><tt class="py-op">)</tt> </tt>
<a name="L86"></a><tt class="py-lineno">86</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-19" class="py-name"><a title="apiclient.model.BaseModel.response
apiclient.model.Model.response" class="py-name" href="#" onclick="return doclink('link-19', 'response', 'link-18');">response</a></tt><tt class="py-op">.</tt><tt class="py-name">status</tt> <tt class="py-op">==</tt> <tt class="py-number">200</tt><tt class="py-op">:</tt> </tt>
<a name="L87"></a><tt class="py-lineno">87</tt>  <tt class="py-line">      <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L88"></a><tt class="py-lineno">88</tt>  <tt class="py-line">        <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">simplejson</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="oauth2client.clientsecrets.loads" class="py-name" href="#" onclick="return doclink('link-20', 'loads', 'link-15');">loads</a></tt><tt class="py-op">(</tt><tt class="py-name">content</tt><tt class="py-op">)</tt> </tt>
<a name="L89"></a><tt class="py-lineno">89</tt>  <tt class="py-line">      <tt class="py-keyword">except</tt> <tt class="py-name">StandardError</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L90"></a><tt class="py-lineno">90</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-21" class="py-name"><a title="oauth2client.client.AccessTokenRefreshError" class="py-name" href="#" onclick="return doclink('link-21', 'AccessTokenRefreshError', 'link-6');">AccessTokenRefreshError</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L91"></a><tt class="py-lineno">91</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">access_token</tt> <tt class="py-op">=</tt> <tt class="py-name">d</tt><tt class="py-op">[</tt><tt class="py-string">'accessToken'</tt><tt class="py-op">]</tt> </tt>
<a name="L92"></a><tt class="py-lineno">92</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L93"></a><tt class="py-lineno">93</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-22" class="py-name"><a title="oauth2client.client.AccessTokenRefreshError" class="py-name" href="#" onclick="return doclink('link-22', 'AccessTokenRefreshError', 'link-6');">AccessTokenRefreshError</a></tt><tt class="py-op">(</tt><tt class="py-name">content</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L94"></a><tt class="py-lineno">94</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Tue Nov  6 12:07:17 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
